Comments/fixes appreciated. computer-support@bio.fsu.edu Port procedures: To get ports (ie on new box): # portsnap fetch extract To update ports tree: # portsnap fetch update To upgrade only the ports that need upgrading, only do this if full version below has been run very recently and no OS upgrade, etc: # portsnap fetch update # portmaster -day To recompile and reinstall all ports, recommended after OS upgrade or more than 1 month since last port upgrade: # portsnap fetch update # pkg delete -f -x "py39-*" # Or whatever the current installed python is. This will either get reinstalled or upgraded. # pkg autoremove -n # Make sure nothing you want is in this list. If so reinstall it manually afterwards. # pkg autoremove -y # portmaster -dafy ** For help with portmaster errors see the bottom of this file. To list installed ports: # pkg info To delete a port without deleting everything that depends on it # pkg delete -f To delete ports based on pattern (ex py39-) # pkg delete -f -x "py39-*" To delete port dependencies no longer needed # pkg autoremove -y To list all ports explicitly installed # pkg query -e '%a = 0' %o To delete all ports and start over: # pkg delete -afy # cd /usr/src # make -DBATCH_DELETE_OLD_FILES delete-old-libs # rm -rf /usr/ports # mkdir /usr/ports # portsnap fetch extract Edit /etc/make.conf and remove entries for perl and any other port. If you changed the shell for your account or root to one from ports change them back to /bin/csh with vipw. Reinstall necessary ports. If MySQL was installed and it updated versions and is having trouble with missing system users, etc, run "/usr/local/libexec/mysqld --upgrade=FORCE" after stopping mysql. To delete all ports, port config files and ports database and start over (this is last resort for ports errors): # pkg delete -afy # cd /usr/src # make -DBATCH_DELETE_OLD_FILES delete-old-libs # mv /usr/local /usr/local.OLD # rm -rf /var/db/pkg /var/db/ports /usr/ports # cd /usr/src # make -DBATCH_DELETE_OLD_FILES delete-old-libs # mkdir /usr/ports # portsnap fetch extract Edit /etc/make.conf and remove entries for perl and any other port. If you changed the shell for your account or root change them back to /bin/csh with vipw. Reinstall necessary ports, run diff .ORIG in /usr/local.OLD/etc to obtain changes to put in new config files. This assumes you made .ORIG copies of the original config files. If MySQL was installed and it updated versions and is having trouble with missing system users, etc, run "/usr/local/libexec/mysqld --upgrade=FORCE" after stopping mysql. Once all ports are updated and everything is working even after a reboot. # make -DBATCH_DELETE_OLD_FILES delete-old-libs To install git # portsnap fetch extract or # portsnap fetch update # cd /usr/ports/devel/git # env FLAVOR=tiny make install clean OS procedures: To get base OS source with git (ie on a new box, ex FreeBSD 13.2) # git clone -b releng/13.2 --depth 1 https://git.freebsd.org/src.git /usr/src would get you 13.2 with latest security patches. To update source with git: # cd /usr/src # git config pull.ff only # git pull To get base OS source with svnlite (ie on a new box, ex FreeBSD 12.2) # svnlite co svn://svn.freebsd.org/base/releng/12.2/ /usr/src would get you 12.2 with latest security patches. To update source with svnlite: # svnlite update /usr/src To update base OS (patches within version only, ie 13.1 patch level 2 -> 13.1 patch level 3): # cd /usr/src # git config pull.ff only # git pull # make cleanworld # chflags -R noschg /usr/obj/* # rm -rf /usr/obj # make buildworld # make buildkernel KERNCONF= # make installkernel KERNCONF= Reboot to single user mode # adjkerntz -i # mount -a -t ufs # cd /usr/src # make installworld To upgrade base OS to later minor version (ex 11.2 -> 11.4): # mv /usr/src /usr/src_11.2 # mkdir /usr/src # svnlite co svn://svn.freebsd.org/base/releng/11.4/ /usr/src # cd /usr/src # make cleanworld # chflags -R noschg /usr/obj/* # rm -rf /usr/obj # make buildworld Make a new config file using /usr/src/sys/amd64/conf/GENERIC and the old one in /usr/src_11.2/sys/amd64/conf # make buildkernel KERNCONF= # make installkernel KERNCONF= Reboot to single user mode # adjkerntz -i # mount -a -t ufs # cd /usr/src # make installworld To upgrade base OS to later major version (ex 12.4 -> 13.2): # cp -rf /etc /etc_12.4 # mv /usr/src /usr/src_12.4 # mkdir /usr/src # git clone -b releng/13.2 --depth 1 https://git.freebsd.org/src.git /usr/src # cd /usr/src # make cleanworld # chflags -R noschg /usr/obj/* # rm -rf /usr/obj # make buildworld Make a new config file using /usr/src/sys/amd64/conf/GENERIC and the old one in /usr/src_12.4/sys/amd64/conf # make buildkernel KERNCONF= # make installkernel KERNCONF= Reboot to single user mode # adjkerntz -i # mount -a -t ufs # cd /usr/src # mergemaster -p # make installworld # make distribution Reset the now blank root password # passwd Reboot. Most files in /etc except rc.conf, fstab,resolv.conf and a few more will be new. Run diff .ORIG in /etc_12.4 to obtain changes to put in new config files. This assumes you made .ORIG copies of the original config files. Usual files to edit in /etc are group, hosts, hosts.allow, passwd, master.passwd, sysctl.conf. Make original copies before editing. If sendmail is enabled, reconfigure /etc/mail. Update ports with "portsnap fetch update" and recompile all ports with "portmaster -dafy". If this fails see the ports troubleshooting section below or reinstall all ports as described in section To delete all ports and start over (above). Once everything is working fine, even after a reboot. # make -DBATCH_DELETE_OLD_FILES delete-old ---------------------------------------------------------------------- Help with portmaster errors. Python, perl issues. Most python and perl issues can be fixed by uninstalling all python, perl, jdk and autoconf ports (see Port procedures section above), deleting any info about perl and python from /etc/make.conf, and running portmaster again. The ports that need python, perl, jdk, etc will cause the lastest version of them to be reinstalled. If still errors try "rm /usr/src/contrib/file/python/*". Run portmaster again. If still errors try moving /usr/ports to /usr/ports.OLD and "mkdir /usr/ports; portsnap fetch extract". Run portmaster again. If still errors see sections above for deleting all ports and starting over. Port installs files in same place as previous port. Delete the previous port with "pkg delete -f " and run portmaster again. Port conflicts with previous port. Delete the previous port with "pkg delete -f " and run portmaster again. When running portmaster again run the same command as originally (ie portmaster -day or portmaster -dafy). You can test fix with "portmaster -day" but if your goal is to recompile all ports at some point run "portmaster -dafy" again. Help with current libpthread-stubs-0.4 error. # portsnap fetch update # portmaster ports-mgmt/pkg # portmaster x11/libxcb # pkg delete -f libpthread-stubs-0.4 # portmaster -day -------------------------------------------------------------------------- Updatinging from 10 or older Update to releng/10.4. clang -v should print clang version 3.4.1. Update to releng/11.2. Update to releng/11.4, or better. ---------------------------------------------------------------------- Change log Version 7.3 5/20/2016: Added delete perl from /etc/make.conf, added sections for upgrade minor and major OS version. 3/9/2017: Added change shell back to csh to section To delete all ports and start over:. 4/27/2021: Added delete ports by pattern 7/12/2022: Added help with portmaster errors section. 9/13/2022: Added more help with portmaster errors section. 11/29/2022: Added section for less involved delete all ports and start over. 4/4/2023: Removed not needed "make cleanworld"s. Added delete-all-libs to ports section. 6/12/2024: Added autoremove to ports section.